package com.hcinfos.gsoo.json;

import java.util.List;

import org.codehaus.jackson.type.TypeReference;
import org.json.JSONObject;

import com.hcinfos.gsoo.enity.ShopEnity;
import com.hcinfos.gsoo.enity.ViewSuppDetail;
import com.hcinfos.gsoo.enity.ViewSuppSearch;
import com.hcinfos.gsoo.enity.ViewSuppSearchExt;
import com.hcinfos.gsoo.util.LogUtil;

public class LBSInfoJson extends BaseJson {

	public static int totalNums = 0;
	public static int state = 0;

	public static List<ViewSuppSearchExt> getLbsInfoListByJson(String result)
			throws Exception {

		JSONObject obj = new JSONObject(result);
		String arrayStr = obj.getString("rows");
		totalNums = Integer.parseInt(obj.getString("total"));
		state = obj.getInt("state");
		List<ViewSuppSearchExt> list = objectMapper.readValue(arrayStr,
				new TypeReference<List<ViewSuppSearchExt>>() {
				});
		LogUtil.d("wxf", "size:" + list.size() + ",totalNums=" + totalNums);
		return list;
	}
}
